﻿@{
    ViewData["Title"] = "Home Page";
    var books = ViewData["books"] as List<ReadingRecord>;
}

<style>
        .flex_content{
            display: flex;
            flex-wrap: wrap;
            justify-content: left;
        }
        .flex_content > div{
            margin: 15px 30px;
            flex-basis: 220px;
            flex-grow: 0;
            flex-shrink: 0;
        }
    </style>
    
<div class="flex_content">
    @foreach (var book in books)
    {
        <div class="card" style="width: 18rem;">
            <a asp-controller="Book" asp-action="BookReader" asp-route-bookId="@book.Book.Id">
                <img src="~/@book.Book.CoverImage" class="card-img-top" alt="...">
            </a>
            <div class="card-body">
                <h5 class="card-title">@book.Book.Title</h5>
                <p class="card-text">作者：@book.Book.Author</p>
                <p class="card-text">上传人：@book.Book.UploadedBy.Nickname</p>
                <p class="card-text">上次阅读： @book.UpdateTime</p>
            </div>
        </div>
    }
</div>